package com.learn.strategy.impl;

import com.learn.strategy.FormSubmitHandler;
import com.learn.strategy.dto.CommonPairResponse;
import com.learn.strategy.dto.FormSubmitRequest;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author tuzhijin
 * @version Id: FormHsfSubmitHandler.java, v 0.1 2021/3/21 下午1:59 tuzhijin Exp $$
 */
@Component
@Slf4j
public class FormHsfSubmitHandler implements FormSubmitHandler {

    @Override
    public String getSubmitType() { return "hsf"; }

    @Override
    public CommonPairResponse handleSubmit(FormSubmitRequest request) {
        log.info("HSF 模式提交：userId={}, formInput={}", request.getUserId(), request.getFormInput());

        // 进行 HSF 泛化调用，获得业务方返回的提示信息和业务数据
        CommonPairResponse response = hsfSubmitData(request);

        return response;
    }

    private CommonPairResponse hsfSubmitData(FormSubmitRequest request) {
        return null;
    }

}

